package com.one.blocks.rbac.controller.vo;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.one.blocks.mvc.controller.valid.Update;
import com.one.blocks.mvc.controller.valid.UpdateSelective;
import com.one.blocks.mvc.domain.Id;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;
import javax.validation.groups.Default;
import java.io.Serializable;

/**
 * @author <a href="mailto:idler41@163.con">idler41</a> created on 2022-05-06 10:54:42
 */
@ApiModel(value = "角色-组织关联")
@Data
public class SysRoleOrgVo implements Id<Integer>, Serializable {

    /**
     * 主键ID
     */
    @ApiModelProperty(value = "主键ID")
    @NotNull(groups = {UpdateSelective.class, Update.class})
    private Integer id;

    /**
     * 角色id
     */
    @ApiModelProperty(value = "角色id")
    @NotNull(groups = {Default.class, Update.class})
    private Integer roleId;

    /**
     * 组织id
     */
    @ApiModelProperty(value = "组织id")
    @NotNull(groups = {Default.class, Update.class})
    private Integer orgId;

    /**
     * 创建者
     */
    @ApiModelProperty(value = "创建者", accessMode = ApiModelProperty.AccessMode.READ_ONLY)
    @JsonProperty(access = JsonProperty.Access.READ_ONLY)
    private Integer createBy;

    /**
     * 创建时间
     */
    @ApiModelProperty(value = "创建时间", accessMode = ApiModelProperty.AccessMode.READ_ONLY)
    @JsonProperty(access = JsonProperty.Access.READ_ONLY)
    private Long createTime;
}